from Base import message, intersect, SS_VALID
from DRG import MDCO_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["67.0x00","67.0x00x002","67.0x01","67.3100","67.3200","67.3200x009","67.3200x012","67.3201","67.3202","67.3203","67.3300","67.3301","67.3302","67.3901","67.3902","67.3903","67.3904","67.3905","67.5900x001","67.5900x002","67.5900x003","67.5901","69.3x00","69.9700","70.1202","70.1300","70.1400x002","70.1400x007","70.1400x012","70.1401","70.1402","70.1403","70.1404","70.1405","70.1407","70.1408","70.3101","70.3304","70.3305","70.4x00x001","70.4x01","70.4x02","70.4x03","70.4x05","70.7100","70.7101","70.7900x010","70.7904","71.0100x003","71.0100x004","71.2200x001","71.2400x001","71.2400x003","71.2401","71.2900x001","71.2900x002","71.3x00x001","71.3x00x007","71.3x00x011","71.3x00x013","71.3x00x021","71.3x00x023","71.3x00x025","71.3x01","71.3x03","71.3x04","71.3x05","71.4x02","71.4x03","71.4x04","71.4x05","71.5x00x001","71.5x00x003","71.5x00x004","71.7101","71.7102","71.8x00","75.8x00x002","75.9900x006","96.1800x001","98.1601","98.1700x001","98.2300x001"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合OD2入组条件，匹配规则：主手术匹配')

    if MDCO_DRG.OD29_group(record):
      return 'OD29'
        
    return 'OD2'
  else:
    return ''
    
